package com.taotao.controller;

import com.taotao.service.PictureService;
import com.taotao.util.PictureResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.multipart.MultipartFile;


/**
 * @author hong.zheng
 * @Description
 * @date 2018-08-24-15:08
 **/
@RequestMapping("/pic")
@Controller
public class PictureController {
    @Autowired
    private PictureService pictureService;

    @RequestMapping("/upload")
    @ResponseBody
    public PictureResult uploda(MultipartFile uploadFile) throws Exception {
        //调用service上传图片
        PictureResult pictureResult = pictureService.uploadFile(uploadFile);
        //返回上传结果
        return pictureResult;

    }
}
